import request from '@/utils/request'

// 获取菜单列表
export const getRouters = () => {
  return request({
      url: 'menu/getMenuTree',
      method: 'post'
  });
}

// 新增菜单
export const addRouters = (data) => {
  return request({
      url: 'menu/addRouters',
      method: 'post',
      data
  });
}

// 更新菜单
export const updateRouters = (data) => {
  return request({
      url: 'menu/updateRouters',
      method: 'post',
      data
  });
}

// 删除菜单
export const removeRouters = (data) => {
  return request({
      url: 'menu/removeRouters',
      method: 'post',
      data
  });
}

// 获取菜单按钮权限列表
export const getMenuButtons = (data) => {
  return request({
      url: 'menu/getMenuButtons',
      method: 'post',
      data
  });
}

// 添加菜单按钮
export const addMenuButton = (data) => {
  return request({
      url: 'menu/addMenuButton',
      method: 'post',
      data
  });
}

// 编辑菜单按钮
export const updateButton = (data) => {
  return request({
      url: 'menu/updateButton',
      method: 'post',
      data
  });
}

// 删除菜单按钮
export const deleteMenuButton = (data) => {
  return request({
      url: 'menu/deleteMenuButton',
      method: 'post',
      data
  });
}